POV-Ray : Newsgroups : povray.beta-test : Heightfield bug (most probably an inverted normals problem) : More info (Was: Heightfield bug (most probably an inverted normals problem)) Server Time
2 Nov 2024 03:16:54 EDT (-0400)
  More info (Was: Heightfield bug (most probably an inverted normals problem))  
From: Warp
Date: 22 Jan 2002 12:14:13
Message: <3c4d9de5@news.povray.org>
It's not actually a heightfield bug. It's a more general phenomenon. If the
angle between the normal vector returned by the object (any object) and the
incoming ray is <90 degrees, then the normal vector is inverted.
  Here is another example where this happens:

camera { location -z*2 look_at 0 }
smooth_triangle
{ <-1,-.2,0>, <-1,1,-1>
  <1,-.2,0>, <1,1,-1>
  <0,.2,2>, <0,1,1>
  pigment { slope y color_map { [0 rgb x][.5 rgb .5][1 rgb 1] } }
  finish{ambient 1}
}

  The normal vector of this smooth triangle points always upwards, never
downwards, and thus it should never get colored red. But the inversion
phenomenon of the normal causes the artifact.

  (I think this was the reason why smooth meshes were double-illuminated by
default. It was a quick trick to get rid of this artifact! However, this
doesn't help with slope patterns.)

  I carefully tested the normal vectors returned by the heightfield object,
and they never point downwards, so the inversion indeed happens at a higher
level in the rendering process.

  However, I understand that removing this inversion could actually break
something else which currently works. One case could perhaps be CSG
illumination and inverted object illumination.

  Any ideas?

-- 
#macro M(A,N,D,L)plane{-z,-9pigment{mandel L*9translate N color_map{[0rgb x]
[1rgb 9]}scale<D,D*3D>*1e3}rotate y*A*8}#end M(-3<1.206434.28623>70,7)M(
-1<.7438.1795>1,20)M(1<.77595.13699>30,20)M(3<.75923.07145>80,99)// - Warp -


Post a reply to this message

Copyright 2003-2023 Persistence of Vision Raytracer Pty. Ltd.